<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        .error{
            color:red;
        }

        .success{
            color: green;
        }
    </style>
</head>
<body>
    <form action="http://www.baidu.com" method="get" onsubmit="return checkUsernameValid() && checkPasswordValid()">
        <p>
            <label for="username">用户名：</label>
            <input type="text" name="username" id="username" onblur="checkUsernameValid()">
            <span id="username_error" class="error"></span>
        </p>
        <p>
            <label>
                密&emsp;码：
                <input type="password" name="pwd" id="password" onblur="checkPasswordValid()">
                <span id="pwd_error" class="error"></span>
            </label>
        </p>
        <p>
            <input type="submit" value="Login">
            <input type="reset" value="Reset">
        </p>
    </form>
    <script src="scripts/login.js"></script>
</body>
</html>